package com.bsit.obu.ui;

import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bsit.obu.R;
import com.bsit.obu.base.BaseActivity;

import butterknife.BindView;
import butterknife.OnClick;


/**
 * 版本信息界面
 * Created by shengbing.liu on 2016/5/17.
 */
public class VersionActivity extends BaseActivity {

    @BindView(R.id.more_iv)
    ImageView mMoreIv;              //菜单栏多图标

    @BindView(R.id.tv_app_version)
    TextView tv_app_version;
    @BindView(R.id.tv_app_uid)
    TextView tv_app_uid;
    @BindView(R.id.qrcode_iv)
    ImageView qrcode_iv;



    @Override
    protected void initView() {
        setContentView(R.layout.activity_version);
    }

    @Override
    protected void fillView() {
        super.fillView();
        mMoreIv.setVisibility(View.INVISIBLE);
        initTitle(R.string.str_version);
        try {
            tv_app_version.setText("版本号:V" + getPackageManager().
                    getPackageInfo(getPackageName(), 0).versionName);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
       // geDsrcUid();
    }
    @OnClick(R.id.tv_app_version)
    void clickAppVersion() {

    }
    private String uid;

/*    private void geDsrcUid(){

        try {
            CommonUtil.sendStrCmd("083700", new SerialService.SerialDataDealListener() {
                @Override
                public void requestSuccess(String result) {
                    MyLog.e(MyLog.TAG, "UID : " + result);
                    uid = result;
                    tv_app_uid.setText("UID: "+uid);
                    try {
                        qrcode_iv.setImageBitmap(QrCodeUtils.createCode(VersionActivity.this,uid));
                    } catch (WriterException e) {
                        e.printStackTrace();
                    }

                }
                @Override
                public void requestFailed() {
                    ToastUtils.showToast(VersionActivity.this,"获取唯一标示错误！");
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }*/
}
